11ed296d1291468e6c0c632ca13b1d8d34264339,applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java,BillingAccountWorker,getBillingAccountBalance,#GenericValue#,140

Before Change


        GenericValue orderPaymentPreferenceSum = EntityUtil.getFirst(delegator.findByCondition("OrderPurchasePaymentSummary", whereConditions, null, UtilMisc.toList("maxAmount"), null, null));
        BigDecimal ordersTotal = null;
        if (UtilValidate.isNotEmpty(orderPaymentPreferenceSum)) {
            ordersTotal = orderPaymentPreferenceSum.getBigDecimal("maxAmount");
        } else {
            ordersTotal = ZERO;
        }

After Change


        List orderPaymentPreferenceSums = delegator.findByCondition("OrderPurchasePaymentSummary", whereConditions, null, UtilMisc.toList("maxAmount"), null, null);
        if (orderPaymentPreferenceSums != null) {
            for (Iterator oppsi = orderPaymentPreferenceSums.iterator(); oppsi.hasNext(); ) {
                GenericValue orderPaymentPreferenceSum = (GenericValue) oppsi.next();
                balance = balance.subtract(orderPaymentPreferenceSum.getBigDecimal("maxAmount"));
            }
        }